package wolonghelp

import (
	"regexp"
	"strings"
)

func CheckEmail(email string) bool {
	r := regexp.MustCompile("[^@ \\t\\r\\n]+@[^@ \\t\\r\\n]+\\.[^@ \\t\\r\\n]+")
	res := r.FindAllStringSubmatch(strings.TrimSpace(email), -1)
	for _, i := range res {
		for _, j := range i {
			if j == strings.TrimSpace(email) {
				return true
			}
		}
	}
	return false
}
